package com.zhengqing.system.api;

import com.zhengqing.common.base.constant.ServiceConstant;
import com.zhengqing.common.core.annotaion.LimiterValite;
import com.zhengqing.common.core.api.BaseController;
import com.zhengqing.system.model.dto.YoutubeGetMediaDto;
import com.zhengqing.system.service.YoutubeDownloadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * youtube工具接口
 *
 * @author des1gn
 * @description
 * @date 2020/4/15 20:50
 */
@Slf4j
@RestController
@RequestMapping(ServiceConstant.SERVICE_API_PREFIX_MINI + "/youtube")
@Api(tags = "YoutubeMpController",description = "youtube")
public class YoutubeMpController extends BaseController {

    @Resource
    private YoutubeDownloadService youtubeDownloadService;


    @Autowired
    private HttpServletRequest request;

    /**
     * youtube发送邮箱
     * @param param
     * @return
     */
    @GetMapping("getToEmail")
    @LimiterValite
    public Boolean getToEmail(YoutubeGetMediaDto param){
       return youtubeDownloadService.sendMqToEmail(param,request);
    }

    /**
     * youtube发送邮箱处理
     * @param param
     * @return
     */
    @GetMapping("getToEmailProcess")
    @LimiterValite
    public Boolean getToEmailProcess(YoutubeGetMediaDto param){
       return youtubeDownloadService.sendMqToEmailProcess(param);
    }




}
